package com.itxx.keycase.blockingqueue;

import java.util.concurrent.ArrayBlockingQueue;

public class Cooker extends Thread {
  private   ArrayBlockingQueue<String> strings;

    public Cooker(ArrayBlockingQueue<String> strings) {
        this.strings = strings;
    }

    public Cooker() {
    }

    @Override
    public void run() {
        while (true) {
            try {
                strings.put("厨师做包子");
                System.out.println("厨师放了一个包子");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
